home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_MacPaint / Source / shared.subproj / RCS / NeXTToMacText.rtf,v < prev    next >
Text File  |  1995-06-12  |  13KB  |  463 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  beta10:1.1;
  5. locks    death:1.2;
  6. comment  @@;
  7.  
  8.  
  9. 1.2
  10. date     93.04.04.23.44.47;  author death;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     93.01.10.15.08.32;  author death;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Sun Apr  4 23:44:46 PDT 1993
  27. @
  28. text
  29. @{\rtf0\ansi{\fonttbl\f0\fnil Palatino-Roman;\f1\ftech Symbol;\f2\fnil Times-Roman;\f3\fnil NewCenturySchlbk-Roman;}
  30. \paperw14520
  31. \paperh13060
  32. \margl120
  33. \margr0
  34. {\colortbl\red0\green0\blue0;}
  35. \pard\tx5700\tx11360\f0\b0\i0\ul0\fs24 $Revision: 1.1 $    $Author: death $    $Date: 93/01/10 15:08:32 $\
  36.  
  37. \pard \
  38.  
  39. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  40.  
  41. \fs28 \
  42.  
  43. \fs16 \
  44.  
  45. \fs28 \
  46.  
  47. \fs16 \
  48.  
  49. \pard\b\li1100 \
  50. \
  51. \
  52. \
  53.  
  54. \fs36 NeXTtoMacText\
  55.  
  56. \fs16 \
  57.  
  58. \pard\tx7140\b0\fs28\li2100 INHERITS FROM    TextConverter\
  59.  
  60. \fs16 \
  61.  
  62. \fs28 DECLARED IN    NeXTtoMacText.h\
  63.  
  64. \fs16 \
  65. \
  66. \
  67.  
  68. \fs28 CLASS DESCRIPTION\
  69.  
  70. \fs16 \
  71.  
  72. \pard\tx3120\tx3620\tx4120\fs28\li2620 The NeXTtoMacText class serves to convert raw text from the standard NeXT character set to the standard Mac character set.  It accomplishes this by overriding the methods provided by TextConverter class, and introducing its own conversion algorithms instead.  See the TextConverter class document for details about the way one of these classes works.\
  73.  
  74. \fs16 \
  75.  
  76. \fs28 This uses the standard NeXTstep encoding vector defined in the version 2 documentation.  Most of the conversion is straight forward.  Those characters that can not be mapped to a single Macintosh character are either not altered at all, and an error code is set, or a string representing them is substituted in their place.  In all cases, there is room for ambiguity when dealing with single quotes.  On the NeXT, the single quotes ` amd ' are both in the ASCII set (below 127) and are also proper 'curly' quotes.  The Mac has a neuter quote and a grave accent that is also used as an opening quote by some in those positions.  Some users would want to convert the NeXT quotes to the Macintosh typograhically pretty quotes, others will want to convert them to the standard ASCII positions.  Thus, this allows a flag (UseCurlyQuotes) to be set to YES if the user wishes to map them to the typographically pretty quotes.  Otherwise standard ASCII ones are generated.
  77. \pard\tx7140\fs16\li2100 \
  78.  
  79. \pard\tx3120\tx3620\tx4120\li2620 \
  80.  
  81. \fs28 A table listing the conversions done by this class is provided at the end.\
  82.  
  83. \fs16 \
  84.  
  85. \pard\tx7140\li2100 \
  86. \
  87.  
  88. \fs28 INSTANCE VARIABLES\
  89.  
  90. \fs16 \
  91.  
  92. \pard\tx7140\tx10180\tx10680\i\fs28\fi-4540\li7140 Declared in MacToNeXTText
  93. \i0     Boolean    strictIM\
  94.  
  95. \pard\tx7140\fs16\li2100 \
  96. \
  97. \
  98.  
  99. \fs28 METHOD TYPES\
  100.  
  101. \fs16 \
  102.  
  103. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Initalizing    
  104. \f1 - 
  105. \f0 init
  106. \pard\tx10180\tx10680\f1\fi-520\li7660 \
  107.  
  108. \pard\tx7140\f0\fs16\li2100 \
  109.  
  110. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Converting characters    
  111. \f1 - 
  112. \f0 ConvertCharacter:\
  113.  
  114. \pard\tx10180\tx10680\f1\fi-520\li7660 - 
  115. \f2 ConvertString:WithLength:
  116. \f1 \
  117.  
  118. \pard\tx7140\f0\fs16\li2100 \
  119.  
  120. \pard\tx7140\tx10180\tx10680\fs28\fi-4540\li7140 Setting conversion type    
  121. \f1 - 
  122. \f0 SetMode:\
  123.  
  124. \pard\tx7140\fs16\li2100 \
  125. \
  126. \
  127.  
  128. \fs28 CLASS METHODS\
  129.  
  130. \fs16 \
  131.  
  132. \b \
  133.  
  134. \b0\fs28 None\
  135.  
  136. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  137.  
  138. \pard\tx7140\li2100 \
  139. \
  140.  
  141. \fs28 INSTANCE METHODS\
  142.  
  143. \fs16 \
  144.  
  145. \b \
  146.  
  147. \fs28 ConvertCharacter:\
  148.  
  149. \pard\b0\fi-1020\li3620 - (Character) 
  150. \b ConvertCharacter: 
  151. \b0 (Character) 
  152. \i macChar\
  153.  
  154. \pard\tx3620\i0\fi-380\li3620 0    Result codes and test\
  155. 1    The returned character
  156. \fs16 \
  157.  
  158. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fi-1020\li3620 \
  159.  
  160. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This returns a single character in the Macintosh character encoding set that most closely matches the specified Macintosh character.  If the match can not be made exactly, this sets the error to 
  161. \fs24 errCANTMAPTOONE.
  162. \fs28  
  163. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fs16\fc0 \
  164. \
  165. \
  166.  
  167. \pard\tx7140\b\fs28\li2100\fc0 ConvertString:WithLength:\
  168.  
  169. \pard\b0\fi-1020\li3620\fc0 - (Pointer) 
  170. \b ConvertString:
  171. \b0  (Pointer) 
  172. \i theData
  173. \i0  
  174. \b WithLength:
  175. \b0  (Integer) 
  176. \i length
  177. \i0 \
  178.  
  179. \pard\tx3620\fi-380\li3620\fc0 0    Result codes and test\
  180. 1    The returned Pointer\
  181. 2    The lenght of the returning data\
  182.  
  183. \pard\tx7140\b\li2100\fc0 \
  184.  
  185. \pard\tx3120\tx3620\tx4120\b0\li2620\fc0 This behaves as documented in the TextConverter class: it converts data from the source string to a destination string it creates, and it then returns this string with its length.  See the description above, and the table below, for encoding details.  \
  186.  
  187. \pard\tx7140\fs16\li2100 \
  188.  
  189. \b \
  190.  
  191. \fs28 init\
  192.  
  193. \pard\f1\b0\fi-1020\li3620 - 
  194. \f0 (Instance) 
  195. \b init\
  196.  
  197. \pard\tx3620\b0\fi-380\li3620 0    Result codes and test\
  198.  
  199. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  200.  
  201. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This initalizes the object, including setting its UseCurlyQuotes flag to NO.  \
  202.  
  203. \pard\tx7140\fs16\li2100 \
  204.  
  205. \b \
  206.  
  207. \fs28 UseCurlyQuotes:\
  208.  
  209. \pard\f1\b0\fi-1020\li3620 - 
  210. \f0 (Instance) 
  211. \b UseCurlyQuotes:
  212. \b0  (Boolean) 
  213. \i useCurlyQuotes
  214. \b\i0 \
  215.  
  216. \pard\tx3620\b0\fi-380\li3620 0    Result codes and test\
  217.  
  218. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  219.  
  220. \pard\tx3120\tx3620\tx4120\b0\fs28\li2620 This allows the caller to specify whether future conversions should convert the NeXTstep characters ` and ' to equivalent 
  221. \i looking
  222. \i0  Macintosh characters (above 128), or equivalent characters in the ASCII set (below 128).  If set to YES, it converts to the upper.  Otherwise, it converts to the lower.  \
  223.  
  224. \fs16 \
  225.  
  226. \pard\tx7140\b\li2100 \
  227.  
  228. \b0 \
  229.  
  230. \fs28 BUGS AND PROBLEMS\
  231.  
  232. \fs16 \
  233.  
  234. \pard\tx3120\tx3620\tx4120\fs28\li2620 I'm not at all sure these are ideal implementations for two reasons: One could argue that a general class that reads a conversion table in would be nicer.  Yet, then one must cart around a conversion table outside the class somewhere, and I don't like that very much, despite its general advantages.  The other is that If one has a string of things to be converted, and would like to do it faster than one character converted per method call, but doesn't want the strings offered in the ConvertString method when an unknown character is found, one is stuck!\
  235.  
  236. \fs16 \
  237.  
  238. \pard\tx7140\li2100 \
  239. \
  240.  
  241. \fs28 ENHANCEMENT IDEAS\
  242.  
  243. \fs16 \
  244.  
  245. \pard\tx3120\tx3620\tx4120\fs28\li2620 none\
  246.  
  247. \fs16 \
  248.  
  249. \pard\tx7140\li2100 \
  250. \
  251.  
  252. \fs28 CONSTANT, DEFINED TYPES AND ERROR CODES\
  253.  
  254. \fs16 \
  255.  
  256. \pard\tx6480\tx7180\fs24\fi-3860\li6480 \
  257.  
  258. \pard\tx3120\tx3620\tx4120\tx7220\li2620 #define errCANTMAPTOONE    1001\
  259.  
  260. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  261.  
  262. \pard\tx7140\li2100 \
  263. \
  264.  
  265. \fs28 CONVERSION TABLE\
  266.  
  267. \fs16 \
  268.  
  269. \pard\tx6480\tx7180\fs24\fi-3860\li6480 \
  270.  
  271. \pard\tx3120\tx3620\tx4120\li2620 Characters from 0x00 to 0x79 are converted exactly as the superclass converts them, with the following exceptions (the second is to convert the line termination character)\
  272.  
  273. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  274.  
  275. \pard\tx6480\tx8640\fs24\fi-2880\li6480 Character name    NeXT code    Mac code\
  276.  
  277. \b0\fc0 NUL    0x00    0x00\
  278. LF/CR    0x0A    0x0C\
  279. quoteright    0x27    0xD4 (only if UseCurlyQuote is YES)\
  280. quoteleft    0x60    0xD5 (only if UseCurlyQuote is YES)\
  281.  
  282. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  283.  
  284. \pard\tx3120\tx3620\tx4120\b0\fs24\li2620 Characters above 0x79 are converted as detailed in the following columns.  Note that an entry of `
  285. \fc0 ——' means that the specified Mac character could not be converted.  When this occurrs, the object returns the Mac character code, and sets an error value.  If the strict Inside Mac V. 1 flag is set, then all characters above D8 are returned as themselves with no error (as shown in column 5).  If one uses the ConvertString method, the object returns the values detailed in column 4.  Note that these never return a value of `——', but instead return the name of the character it could not convert. (the values with `——' in the final column will get the strings showin the ConvertString column if this flag is set when calling that method)\
  286.  
  287. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs16\fi-1020\li3620 \
  288.  
  289. \pard\tx5780\tx7400\tx9020\tx11180\fs24\fi-2160\li5760 Character name    NeXT code    Mac code    ConvertString\
  290.  
  291. \b0\fc0 nbspace    0x80    0xCA    0xCA\
  292. Agrave    0x81    0xCB    0xCB\
  293. Aacute    0x82    0xE7    0xE7\
  294. Acircumflex    0x83    0xE5    0xE5\
  295. Atilde    0x84    0xCC    0xCC\
  296. Adieresis    0x85    0x80    0x80\
  297. Aring    0x86    0x81    0x81\
  298. Ccedilla    0x87    0x82    0x82\
  299. Egrave    0x88    0xE9    0xE9\
  300. Eacute    0x89    0x83    0x83\
  301. Ecircumflex    0x8A    0xE6    0xE6\
  302. Edieresis    0x8B    0xE8    0xE8\
  303. Igrave    0x8C    0xED    0xED\
  304. Iacute    0x8D    0xEA    0xEA\
  305. Icircumflex    0x8E    0xEB    0xEB\
  306. Idieresis    0x8F    0xEC    0xEC\
  307. Eth    0x90    ——    [Eth]\
  308. Ntilde    0x91    0x84    0x84\
  309. Ograve    0x92    0xF1    0xF1\
  310. Oacute    0x93    0xEE    0xEE\
  311. Ocircumflex    0x94    0xEF    0xEF\
  312. Otilde    0x95    0xCD    0xCD\
  313. Odieresis    0x96    0x85    0x85\
  314. Ugrave    0x97    0xF4    0xF4\
  315. Uacute    0x98    0xF2    0xF2\
  316. Ucircumflex    0x99    0xF3    0xF3\
  317. Udieresis    0x9A    0x86    0x86\
  318. Yacute    0x9B    ——    [Yacute]\
  319. Thorn    0x9C    ——    [Thorn]\
  320. mu    0x9D    0xB5    0xB5\
  321. multiply    0x9E    ——    [multiply]\
  322. divide    0x9F    0xD6    0xD6\
  323. copyrightserif    0xA0    0xA9    0xA9\
  324. exclamdown    0xA1    0xC1    0xC1\
  325. cent    0xA2    0xA2    0xA2\
  326. sterling    0xA3    0xA3    0xA3\
  327. fraction    0xA4    0xDA    0xDA\
  328. yen    0xA5    0xB4    0xB4\
  329. florin    0xA6    0xC4    0xC4\
  330. section    0xA7    0xA4    0xA4\
  331. currency    0xA8    0xDB    0xDB\
  332. quotesingle    0xA9    0x27    0x27\
  333. quotedblleft    0xAA    0xD2    0xD2\
  334. guillemotleft    0xAB    0xC7    0xC7\
  335. guilsinglleft    0xAC    0xDC    0xDC\
  336. guilsinglright    0xAD    0xDD    0xDD\
  337. fi    0xAE    0xDE    0xDE\
  338. fl    0xAF    0xDF    0xDF\
  339. registerserif    0xB0    0xA8    0xA8\
  340. endash    0xB1    0xD0    0xD0\
  341. dagger    0xB2    0xA0    0xA0\
  342. daggerdbl    0xB3    0xE0    0xE0\
  343. periodcentered    0xB4    0xE1    0xE1\
  344. brokenbar    0xB5    ——    [brokenbar]\
  345. paragraph    0xB6    0xA6    0xA6\
  346. bullet    0xB7    0xA5    0xA5\
  347. quotesinglebase    0xB8    0xE2    0xE2\
  348. quotedblbase    0xB9    0xE3    0xE3\
  349. quotedblright    0xBA    0xD3    0xD3\
  350. guillemotright    0xBB    0xC8    0xC8\
  351. elipsis    0xBC    0xC9    0xC9\
  352. perthousand    0xBD    0xE4    0xE4\
  353. logicalnot    0xBE    0xC2    0xC2\
  354. questiondown    0xBF    0xC0    0xC0\
  355. onesuperior    0xC0    ——    [
  356. onesuperior
  357. ]\
  358. grave    0xC1    0x60    0x60\
  359. acute    0xC2    0xAB    0xAB\
  360. circumflex    0xC3    0xF6    0xF6\
  361. tilde    0xC4    0xF7    0xF7\
  362. macron    0xC5    0xF8    0xF8\
  363. breve    0xC6    0xF9    0xF9\
  364. dotaccent    0xC7    0xFA    0xFA\
  365. dieresis    0xC8    0xAC    0xAC\
  366. twosuperior    0xC9    ——    [twosuperior]\
  367. ring    0xCA    0xFB    0xFB\
  368. cedilla    0xCB    0xFC    0xFC\
  369. threesuperior    0xCC    ——    [threesuperior]\
  370. hungarumlaut    0xCD    0xFD    0xFD\
  371. ogonek    0xCE    0xFE    0xFE\
  372. caron    0xCF    0xFF    0xFF\
  373. emdash    0xD0    0xD1    0xD1\
  374. plusminus    0xD1    0xB1    0xB1\
  375. onequarter    0xD2    ——    [
  376. onequarter
  377. ]\
  378. onehalf    0xD3    ——    [onehalf]\
  379. threequarters    0xD4    ——    
  380. \pard\tx533\tx1067\tx1601\tx2135\tx2668\tx3202\tx3736\tx4270\tx4803\tx5337\fc0 [threequarters]
  381. \pard\tx5780\tx7400\tx9020\tx11180\fi-2160\li5760\fc0 \
  382. agrave    0xD5    0x88    0x88\
  383. aacute    0xD6    0x87    0x87\
  384. acircumflex    0xD7    0x89    0x89\
  385. atilde    0xD8    0x8B    0x8B\
  386. adieresis    0xD9    0x8A    0x8A\
  387. aring    0xDA    0x8C    0x8C\
  388. ccedilla    0xDB    0x8D    0x8D\
  389. egrave    0xDC    0x8F    0x8F\
  390. eacute    0xDD    0x8E    0x8E\
  391. ecircumflex    0xDE    0x90    0x90\
  392. dieresis    0xDF    0x91    0x91\
  393. igrave    0xE0    0x93    0x93\
  394. AE    0xE1    0xAE    0xAE\
  395. iacute    0xE2    0x92    0x92\
  396. ordfeminine    0xE3    0xBB    0xBB\
  397. icircumflex    0xE4    0x94    0x94\
  398. idieresis    0xE5    0x95    0x95\
  399. eth    0xE6    ——    [eth]\
  400. ntilde    0xE7    0x96    0x96\
  401. Lslash    0xE8    ——    [Lslash]\
  402. Oslash    0xE9    0xAF    0xAF\
  403. OE    0xEA    0xCE    0xCE\
  404. ordmasculine    0xEB    0xBC    0xBC\
  405. ograve    0xEC    0x98    0x98\
  406. oacute    0xED    0x97    0x97\
  407. ocircumflex    0xEE    0x99    0x99\
  408. otilde    0xEF    0x9B    0x9B\
  409. odieresis    0xF0    0x9A    0x9A\
  410. ae    0xF1    0xBE    0xBE\
  411. ugrave    0xF2    0x9D    0x9D\
  412. uacute    0xF3    0x9C    0x9C\
  413. ucircumflex    0xF4    0x9E    0x9E\
  414. dotlessi    0xF5    0xF5    0xF5\
  415. udieresis    0xF6    0x9F    0x9F\
  416. yacute    0xF7    ——    [yacute]\
  417. lslash    0xF8    ——    [lslash]\
  418. oslash    0xF9    0xBF    0xBF\
  419. oe    0xFA    0xCF    0xCF\
  420. germandbls    0xFB    0xA7    0xA7\
  421. thorn    0xFC    ——    [thorn]\
  422. ydieresis    0xFD    0xD8    0xD8\
  423. not defined    0xFE    ——    
  424. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 [not 
  425. \pard\tx5780\tx7400\tx9020\tx11180\fi-2160\li5760\fc0 defined
  426. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 ]
  427. \pard\tx5780\tx7400\tx9020\tx11180\fi-2160\li5760\fc0 \
  428. ascii ctrl char    0xFF    ——    
  429. \pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc0 [ascii control char]
  430. \pard\tx5780\tx7400\tx9020\tx11180\fi-2160\li5760\fc0 \
  431.  
  432. \pard\tx3120\tx3620\tx4120\fs16\li2620 \
  433.  
  434. \pard\tx7140\li2100 \
  435. \
  436.  
  437. \fs28 MODIFICATION HISTORY\
  438.  
  439. \fs16 \
  440.  
  441. \pard\tx3120\tx3620\tx4120\fs28\li2620 $Log:    NeXTToMacText.rtf,v $
  442. Revision 1.1  93/01/10  15:08:32  death
  443. Sun Jan 10 15:08:32 PST 1993
  444.  
  445. \fi-20\li3120 \
  446.  
  447. }
  448. @
  449.  
  450.  
  451. 1.1
  452. log
  453. @Sun Jan 10 15:08:32 PST 1993
  454. @
  455. text
  456. @d7 1
  457. a7 1
  458. \pard\tx5700\tx11360\f0\b0\i0\ul0\fs24 $Revision: 1.2 $    $Author: death $    $Date: 92/04/05 22:52:03 $\
  459. d413 4
  460. a416 1
  461. \pard\tx3120\tx3620\tx4120\fs28\li2620 $Log:    $
  462. @
  463.